package com.shadt.cloud.service;

import java.util.List;

import com.shadt.cloud.entity.User;
import com.shadt.cloud.vo.BranchChannelVo;
import com.shadt.cloud.vo.BranchVo;
import com.shadt.cloud.vo.ChannelVo;

/**
 * 后台业务逻辑层接口
 * @author SongR
 *
 */
public interface AdminService {

	/**
	 * 用户登录
	 */
	User login(User user) throws Exception;

	/**
	 * 验证平台名称是否存在
	 * @param trim
	 * @return
	 */
	boolean checkName(String name) throws Exception;

	/**
	 * 用户注册
	 * @param branch
	 * @return
	 */
	User register(User user) throws Exception;

	/**
	 * 获取所有父栏目
	 * @param sSearch
	 * @param iDisplayStart
	 * @param iDisplayLength
	 * @param id
	 * @return
	 * @throws Exception
	 */
	List<ChannelVo> getParentChannel(String sSearch, int iDisplayStart, int iDisplayLength) throws Exception;
	/**
	 * 获取所有父栏目
	 * @throws Exception
	 */
	List<ChannelVo> getParentChannel() throws Exception;
	/**
	 * 获取栏目父记录数
	 * @param sSearch
	 * @param id
	 * @return
	 * @throws Exception
	 */
	String countParentChannel(String sSearch) throws Exception;

	/**
	 * 获取所有子栏目
	 * @param sSearch
	 * @param iDisplayStart
	 * @param iDisplayLength
	 * @param id
	 * @param bid 
	 * @return
	 * @throws Exception
	 */
	List<ChannelVo> getChildChannel(String sSearch, int iDisplayStart, int iDisplayLength, String id, Long bid) throws Exception;

	/**
	 * 获取子栏目数
	 * @param sSearch
	 * @param id
	 * @return
	 * @throws Exception
	 */
	String countChildChannel(String sSearch, String id) throws Exception;

	/**
	 * 栏目权限申请
	 * @param key
	 * @param name
	 * @param id
	 * @return
	 */
	boolean applyChannel(String key, String name, Long id) throws Exception;

	/**
	 * 取消权限申请
	 * @param key
	 * @param id
	 * @return
	 * @throws Exception
	 */
	boolean cancelApplyChannel(String key, Long id) throws Exception;
	/**
	 * 暂停权限
	 * @param key
	 * @param id
	 * @return
	 * @throws Exception
	 */
	boolean stopApplyChannel(String key, Long id) throws Exception;

	/**
	 * 恢复权限
	 * @param key
	 * @param id
	 * @return
	 */
	boolean recoveryApplyChannel(String key, Long id) throws Exception;

	/**
	 * 获取申请列表
	 * @param sSearch
	 * @param iDisplayStart
	 * @param iDisplayLength
	 * @param u 
	 * @return
	 * @throws Exception
	 */
	List<BranchChannelVo> getBranchChannel(String sSearch, int iDisplayStart, int iDisplayLength, User u) throws Exception;

	/**
	 * 获取申请列表数
	 * @param sSearch
	 * @param u 
	 * @return
	 * @throws Exception
	 */
	Object countBranchChannel(String sSearch, User u) throws Exception;

	/**
	 * 根据用户获取商户列表
	 * @param id
	 * @return
	 */
	List<BranchVo> getBranch(Long id,Integer type) throws Exception;

	/**
	 * 退出登录
	 * @param u
	 * @throws Exception
	 */
	boolean logout(User u) throws Exception;

	void setState(Long id, int i) throws Exception;

	void setChannelState(String key, Long long1, int i) throws Exception;


	
}
